package com.example.e11_q3;

/**
 * @desc:
 * @author: Shoko
 * @date: 2025/6/13
 */
import java.util.ArrayList;
import java.util.List;

public class EmployeeList {
    private List<Employee> employees = new ArrayList<>();

    public void addEmployee(Employee employee) {
        employees.add(employee);
    }

    // 接受访问者，让所有员工依次被访问
    public void accept(EmployeeVisitor visitor) {
        for (Employee emp : employees) {
            emp.accept(visitor);
        }
    }
}
